from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

url = 'https://imooc.com'

driver = webdriver.Chrome()
driver.get(url)
sleep(2)

## begin

result1 = driver.find_element(By.ID, 'globalTopBanner')
print("result1: ", result1)

result2 = driver.find_element(By.TAG_NAME, 'html')
print("result2: ", result2)

result3 = driver.find_elements(By.TAG_NAME, 'link')
print("result3: ", len(result3), result3)

result4 = driver.find_elements(By.LINK_TEXT, '免费课')
print("result4: ", len(result4), result4)

sleep(2)
driver.quit()